<template>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item v-for="(route, index) in breads" :key="index">
      <span v-if="breads.length - 1 === index">{{ route.meta.title }}</span>
      <router-link v-else :to="route">{{ route.meta.title }}</router-link>
    </el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script>
export default {
  name: 'GBreadCrumb',
  created () {
    // console.log('matched', this.$route.matched)
  },
  computed: {
    breads () {
      return this.$route.matched
    }
  }
}
</script>
